﻿using System;
using System.Collections;
using System.Collections.Generic;
namespace WPFExcelReport
{
    public class AB55GZ12Report : BaseReport
    {
        string strCompany = "HLT";
        string strExcelFile = "";
        public AB55GZ12Report()
            : base()
        {
            AssignColumns();
        }

        public AB55GZ12Report(Dictionary<string, object> dicParamater)
            : base(dicParamater)
        {
            strCompany = dicParamater["Company"].ToString().Trim();
            strExcelFile = dicParamater["ExcelFile"].ToString().Trim();
            AssignColumns();
        }
       private void AssignColumns()
        {
            columns.Clear();
            columns.Add("WEAVINGORDER"); columns.Add("LSNAME1");columns.Add("ABPSTARTDAT"); 
            columns.Add("ARTICLE"); columns.Add("WARPQTY");
            columns.Add("YARN"); columns.Add("COLOR"); columns.Add("WARPINGORDER"); columns.Add("REQUIREMENT");
            columns.Add("ALLOCATION"); columns.Add("DNQTY"); columns.Add("REMAIN");
        }
       
        public override void WriteExcelReport(string fileType)
        {
            Queue CellQueue = new Queue();
            string filename = "";
            string sheetName = "";
            string Standard = "HLTAB55GZ12";
            strExcelFile = @"HLT\HLTPlanningReport.xls";
            string filePath = @"C:\intex.w\Report\" + strExcelFile;
            exAgent.Open(filePath);
            exAgent.strExcelFile = strExcelFile;
            string filedate = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString();
            filename = @"Planning\织造\配纬统计" + filedate + ".xls";
            sheetName = DateTime.Now.ToShortTimeString().Replace(@":", "");
            exAgent.CreateNewSheet(filename, Standard, sheetName);
            FillInData(columns, dsSource.Tables["AB55GZ12"]);
            base.WriteExcelReport(fileType);
                      
        }
    }
}
